/* 
    <provides OS-like functionality using a time-triggered scheduler>
    Copyright (C) <2012>  <Jonathan D. Armstrong> <jonathan.armstrong AT mavs.uta.edu>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#include "projectdefs.h"
#include "interrupt.h"

/* setup simulated hardware timer interrupt */
void init_timer_interrupt(void)
{
    /* Establish a handler for SIGALRM signals. */
    signal(SIGALRM, timer_interrupt);
    /* Set an alarm to go off in a little while. */
    alarm(1);
}

/* sleep for 1 second */
void delay_1s(void)
{
    sleep(1);
}

void disable_interrupts(void)
{
    /* FIXME: anything to do here for PC port? */
}

void enable_interrupts(void)
{
    /* FIXME: anything to do here for PC port? */
}

void init_hardware(void)
{
    /* FIXME: anything to do here for PC port? */
}

void led1_toggle(void)
{
    /* simulate LED press here somehow */
}

void led2_toggle(void)
{
    /* simulate LED press here somehow */
}